package com.snailhd.factory;


import com.snailhd.common.db.SimpleMySQLClient;

/**
 * @author hd
 * @description
 * @date 2019-08-19 10:58
 */
public class MysqlFactory {

    private final static String driverClassName = "com.mysql.jdbc.Driver";
    private final static String url = "jdbc:mysql://127.0.0.1:3306/snailhd_cloud?useUnicode=true&characterEncoding=utf-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true";
    private final static String username = "root";
    private final static String password = "Sa23sdsdf";

    private static SimpleMySQLClient client;

    public static SimpleMySQLClient getClient(){
        if(client==null){
            synchronized (SimpleMySQLClient.class){
                if(client==null){
                    client = new SimpleMySQLClient(driverClassName,url,username,password);
                }
            }
        }
        return client;
    }
}
